<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>学生端|学生信息管理系统</title>
		<link rel="stylesheet" type="text/css" href="css/identify.css" />
		<link rel="stylesheet" type="text/css" href="css/layout.css" />
		<link rel="stylesheet" type="text/css" href="css/account.css" />
		<link rel="stylesheet" type="text/css" href="css/style.css" />
		<link rel="stylesheet" type="text/css" href="css/control_index.css" />
		<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="js/layer/layer.js"></script>
		<script type="text/javascript" src="js/haidao.offcial.general.js"></script>
		<script type="text/javascript" src="js/select.js"></script>
		<script type="text/javascript" src="js/haidao.validate.js"></script>
		<script type="text/javascript">
			
		</script>
	</head>

	<body>
		<div class="view-topbar">
			<div class="topbar-console">
				<div class="tobar-head fl">
					<!--  <a href="#" class="topbar-logo fl">
					<span><img src="Images/logo.png" width="20" height="20"/></span>
					</a>-->
					<a href="studentMain.html" class=" topbar-btn text-center fl" style="width: 180px; border-right: 1px solid #008fbf;"><span>学生端|学生成绩管理系统</span></a>
				</div>
			</div>
			<div class="topbar-info">
				<ul class="fr">
					
					
					<li class="fl topbar-info-item">
					
					</li>
					<li class="fl topbar-info-item">
					<div class="dropdown">
						<a href="#" class="topbar-btn">
						<span id="stuname" class="fl text-normal">六个核桃</span>
						<span class="icon-arrow-down"></span>
						</a>
						<ul class="dropdown-menu">
							<li><a href="login.html">退出</a></li>
						</ul>
					</div>
					</li>
				</ul>
			</div>
		</div>
		<div class="view-body">
			<div class="view-sidebar">
				<div class="sidebar-content">
					<div class="sidebar-nav">
						<div class="sidebar-title">
							<a href="#">
								<span class="icon"><b class="fl icon-arrow-down"></b></span>
								<span class="text-normal">个人信息</span>
							</a>
						</div>
						<ul class="sidebar-trans">
							<li>
								<a href="#" id="link1">
									<b class="sidebar-icon"></b>
									<span class="text-normal">个人信息查看</span>
								</a>
							</li>
							<li>
								<a href="#" id="link2">
									<b class="sidebar-icon"></b>
									<span class="text-normal">修改登录密码</span>
								</a>
							</li>
							
						</ul>
					</div>
				<div class="sidebar-nav">
						<div class="sidebar-title">
							<a href="#" >
								<span class="icon"><b class="fl icon-arrow-down"></b></span>
								<span class="text-normal">班级信息</span>
							</a>
						</div>
						<ul class="sidebar-trans">
							<li>
								<a href="#" id="link3">
									<b class="sidebar-icon"></b>
									<span class="text-normal">班级成员查看</span>
								</a>
							</li>
						</ul>
					</div>
					<div class="sidebar-nav">
						<div class="sidebar-title">
							<a href="#">
								<span class="icon"><b class="fl icon-arrow-down"></b></span>
								<span class="text-normal">成绩信息</span>
							</a>
						</div>
						<ul class="sidebar-trans">
							<li>
								<a href="#" id="link4">
									<b class="sidebar-icon"></b>
									<span class="text-normal">成绩查询</span>
								</a>
							</li>
						</ul>
					</div>
					<div class="sidebar-nav">
						<div class="sidebar-title">
							<a href="#">
								<span class="icon"><b class="fl icon-arrow-down"></b></span>
								<span class="text-normal">成绩反馈</span>
							</a>
						</div>
						<ul class="sidebar-trans">
							<li>
								<a href="#" id="link5">
									<b class="sidebar-icon"></b>
									<span class="text-normal">填写成绩反馈</span>
								</a>
							</li>

							
						</ul>
					</div>
					
				</div>
			</div>
		
				<div class="view-product">
				<div class="message-manage">
					<div class="manage-head">
						<h6 class="padding-left manage-head-con">修改密码</h6>
					</div>
					<div class="manage-detail">
						<h6 class="h5 text-big">该界面用于登录密码修改</h6>
						
					</div>
					
					<!-- 表单数据传到相应的Servlet的修改密码的方法中 -->
			
						<form action="<c:url value='/UserServlet'/>" method="post">
							<input type="hidden" name="method" value="modifyPassword"/>
							<div class="margin-tb manage-detail-con clearfix" style="margin-left:20px;">		
								<label id="msg" colspan="2" style="color: #fff00;background-color: #fff00;font-weight:900;" ></label><!-- 用于显示"修改密码成功字眼" -->
							</div>
							<div class="manage-detail">
								<div class="margin-tb manage-detail-con clearfix" >
									<span class="h5 fl"><em class="h2" style="color:#000000;">原始密码</em></span>
									<span class="h5 fl">
										<input style="border: 3px solid #DADADA;height: 30px;width: 200px;margin-left: 15px;" type="password" name="loginpass" id="oldpsw" value=""/>
									</span>	
									<span class="h5 fl">
										<label id="reloginpassError" style="color: #fff00;background-color: #fff00;font-weight:900;"></label>
									</span>		
													
								</div>
							</div>
							<div class="manage-detail">
								
								<div class="margin-tb manage-detail-con clearfix">
									<span class="h5 fl"><em class="h2" style="color:#000000;">新密码</em></span>
									<span class="h5 fl">
										<input style="border: 3px solid #DADADA;height: 30px;width: 200px;margin-left: 40px;" type="password"  name="newpass" id="newpsw" value=""/></td>
									</span>
									<span class="h5 fl">
										<label id="reloginpassError" style="color: #fff00;background-color: #fff00;font-weight:900;"></label>
									</span>										
								</div>
							</div>
							<div class="manage-detail">
								
								<div class="margin-tb manage-detail-con clearfix" >
									<span class="h5 fl"><em class="h2" style="color:#000000;">确认密码</em></span>
									<span class="h5 fl">
										<input style="border: 3px solid #DADADA;height: 30px;width: 200px;margin-left: 15px;" type="password" name="reloginpass" id="reloginpass" value=""/>
									</span>		
									<span class="h5 fl">
										<label id="reloginpassError" style="color: #fff00;background-color: #fff00;font-weight:900;"></label>
									</span>								
								</div>
							</div>
							<div class="margin-tb manage-detail-con clearfix" >		
									<span class="h5 fl">
										<input style="height:50px;width:90px;margin-left:185px" onclick="changePsw()" class="text-big" id="submit" type="button" value="修改密码"/>
									</span>									
							</div>
							
				       </form>
				</div>
				</div>
				<div class="clear">
				</div>
				<div class="show-page padding-big-right hidden">
					<div class="page">
					</div>
				</div>
			</div>
			
	     <script type="text/javascript">
				var str=location.href;
				var num=str.indexOf("?");
				var str1=str.substr(num+1);
				var username=str1.split("=")[1];
				//window.alert(username);
				var text=document.getElementById("stuname");
				
				function getXmlHttpObject(){
				var xmlHttpRequest;
				if(window.ActiveXObject){
					}else{
						xmlHttpRequest=new XMLHttpRequest();
					}
					return xmlHttpRequest;
				}
				function changePsw(){
					myXmlHttpRequest=getXmlHttpObject();
						if(myXmlHttpRequest){
							var oldpsw=document.getElementById("oldpsw").value;
							var newpsw=document.getElementById("newpsw").value;
							var url="http://localhost:8080/StuScoreSystem/Login?method=changePsw&username="+username+"&oldpsw="+oldpsw+"&newpsw="+newpsw+"&post=student";
							myXmlHttpRequest.open("get",url,true);
							myXmlHttpRequest.onreadystatechange=progress;
							myXmlHttpRequest.send(null);
						}
						else{
							window.alert("error");
						}
				}
				function progress(){
					if(myXmlHttpRequest.readyState==4){
						var json=myXmlHttpRequest.responseText;
						var json_obj=eval("("+json+")");
						//var json1=JSON.parse(json);
						var state_obj=json_obj.meta;
						window.alert(state_obj.message);
						location.reload(true); 
						//window.close();
					}
				}
				
				document.getElementById('link1').href="studentSelfInfo.html"+"?"+"username="+username;
				document.getElementById('link2').href="modifyPassword.html"+"?"+"username="+username;
				document.getElementById('link3').href="classmates.html"+"?"+"username="+username;
				document.getElementById('link4').href="scoreInformation.html"+"?"+"username="+username;
				document.getElementById('link5').href="scoreFeedBack.html"+"?"+"username="+username;
				
				
				//text.innerHTML=username;
		</script>
		<script>
			$(".sidebar-title").live('click', function() {
				if ($(this).parent(".sidebar-nav").hasClass("sidebar-nav-fold")) {
					$(this).next().slideDown(200);
					$(this).parent(".sidebar-nav").removeClass("sidebar-nav-fold");
				} 
			});
		</script>
	</body>

</html>